/**
 * 
 */
package com.wbcs.jbsf.format.impl;

import com.wbcs.config.Config;
import com.wbcs.jbsf.format.IFormat;

/**
 * @author hawkfly
 */
public class WbcsPageId2UrlFormat implements IFormat
{
    /* 
     * 
     * 将PAGEID{***}格式化为/prjname/ShowReport.wx?PAGEID=***这样的格式
     */
    public String StrFomat(String str)
    {
        if(str.indexOf("PAGEID{") != -1){
            String pageid = str.substring(str.indexOf("PAGEID{")+7,str.lastIndexOf("}"));
            //String webroot = Config.getInstance().getSystemConfigValue("webroot", "");
            String showreportUrl = Config.getInstance().getSystemConfigValue("showreport-url", "");
            StringBuffer sb = new StringBuffer().append(showreportUrl).append("?PAGEID=").append(pageid);
            return sb.toString();
        }else{
            return str;
        }
    }

}

